Wiki

Clone wiki

inf225 / glossary / Production rule

[Alphabetical Index | Tag Index]

Production rule

A rule describing which symbols may replace other symbols in a grammar. In a context-free grammar, the left-hand side consists of a single nonterminal symbol, while the right-hand side may be any sequence of terminals and nonterminals. For example, Expr ::= Expr "+" Expr says that anywhere you may have an expression, you can have an expression plus another expression. The rules may be used to generate syntactically correct strings, by applying them as rewrite rules starting with the start symbol, or be used to parse strings, e.g., in a top-down parser or bottom-up parser.

Updated